﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 死锁
{
   public class Account
    {
        private double _balance;
        private int _id;
        public Account(int id, double balance)
        {
            this._id = id;
            this._balance = balance;
        }


        public int ID
        {
            get { return _id; }
        }


        //取款

        public void Withdraw(double amount)
        {
            _balance -= amount;
        }


        //存款

        public void Deposit(double amount)
        {
            _balance += amount;
        }


    }
}
